Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Fix static linking on Mac #16

Merged
merged 3 commits into from
Oct 20, 2023
Merged

Fix static linking on Mac #16

merged 3 commits into from
Oct 20, 2023

Conversation

david-zk
Copy link
Contributor

-framework Security flag was missing, when building subnet-evm this flag seems to be added automatically as build works.

We remove all dynamic library builds to make sure only static library is linked by the next build step.

@david-zk david-zk changed the title Fix static linking on mac Fix static linking on Mac Oct 20, 2023

.PHONY: build-tfhe-rs-capi
build-tfhe-rs-capi:
cd tfhe-rs && make build_c_api_experimental_deterministic_fft
cd tfhe-rs && make build_c_api_experimental_deterministic_fft \
&& cd target/release && rm -f *.dylib *.dll *.so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to rm here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I saw the description. Wouldn't it work even if we don't remove?

Copy link
Contributor Author

@david-zk david-zk Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default linker prefers dynamic libraries if they are available, now we specify tfhe lib with -ltfhe flag, which doesn't imply if it is static or dynamic, so if we remove dynamic libraries, linker is forced to link statically

Copy link
Contributor Author

@david-zk david-zk Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would work, but then on macbook it links dynamically, I tried -l:libtfhe.a flag but it doesn't work

@david-zk david-zk merged commit b863ebb into main Oct 20, 2023
1 check passed
@david-zk david-zk deleted the fix/static_linking branch October 20, 2023 09:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants